package com.leapp.sk.ui.activity.join

import android.os.Bundle
import android.support.v4.app.Fragment
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.ChoseClassEntity
import com.leapp.sk.bean.TopLayoutTitleEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.ui.fragment.examination.AlreadyPassedFragment
import com.leapp.sk.ui.fragment.examination.NotPassedFragment
import com.leapp.sk.ui.fragment.examination.ToBeAuditedFragment
import com.leapp.sk.viewdelegate.join.JoinClassExaminationDelegate

/**
 * 入班审核
 * @author  chaohaipeng  on 2018/8/14.
 */
class JoinClassExaminationActivity :BaseActivityMVP<JoinClassExaminationDelegate>(){
    /**
     * fragment数据集合
     */
    private var fragmentLists = mutableListOf<Fragment>()
    /**
     * 标签集合
     */
    private var titles = mutableListOf<TopLayoutTitleEntity>()
    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle("等你下课1班")
    }

    override fun initDate() {
        fragmentLists.add(ToBeAuditedFragment())
        fragmentLists.add(AlreadyPassedFragment())
        fragmentLists.add(NotPassedFragment())
        val topULayoutTitleEntity = TopLayoutTitleEntity()
        topULayoutTitleEntity.title =resources.getString(R.string.string_examination_tobe)
        val topRLayoutTitleEntity = TopLayoutTitleEntity()
        topRLayoutTitleEntity.title = resources.getString(R.string.string_examination_passed)
        val notRLayoutTitleEntity = TopLayoutTitleEntity()
        notRLayoutTitleEntity.title = resources.getString(R.string.string_examination_not_passed)
        titles.add(topULayoutTitleEntity)
        titles.add(topRLayoutTitleEntity)
        titles.add(notRLayoutTitleEntity)
        viewDelegate.initTabLayout(this,fragmentLists,titles)
        val className = mutableListOf<ChoseClassEntity>()
        for (i in 0..3){
            if(i==0){
                val choseClassEntity = ChoseClassEntity()
                choseClassEntity.isCheck=true
                className.add(choseClassEntity)
            }else{
                className.add(ChoseClassEntity())
            }

        }
        viewDelegate.initClassData(this,className)

    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<JoinClassExaminationDelegate> {
        return JoinClassExaminationDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }
}